cli: also log applier debug messages to debug log file#3457
Conversation
✅ Deploy Preview for constellation-docs canceled.
|
|
|
||
| fileHandler := file.NewHandler(afero.NewOsFs()) | ||
| logger, err := newDebugFileLogger(cmd, fileHandler) | ||
| debugLogger, err := newDebugFileLogger(cmd, fileHandler) |
There was a problem hiding this comment.
I don't understand why we have two loggers in this func. Should we just log everything with this logger?
There was a problem hiding this comment.
The other logger log is now only used in the warnLogger, which in turn is only used https://github.com/edgelesssys/constellation/blob/euler/cli/extend-file-debug-log/cli/internal/cmd/applyinit.go#L33. I think in general terms, we want to print warning non-structured, so not with slog.
The simplest solution would be to use the debugLogger instead of log when creating the warnLogger and in the warnLogger's implementation we debug log additionally when calling Warn.
EDIT: this would print the warning twice to the user, once structured and once unstructured when debug is enabled, which is fine in my opinion.
There was a problem hiding this comment.
The current state (last commit) is a proposal for this version.
There was a problem hiding this comment.
I agree that printing the warning as structured debug log again is fine.
Coverage report
|
* cli: also log applier debug messages to debug log file * cli: use debug logger instead of cliLogger
Context
Currenlty, when the coordinator is not reachable, the last log line is
Proposed change(s)
Now the logs also containt he following messages each time the CLI tries to init (those were previously only available directly in the cli output but not in the constellation-debug.log file)
Checklist